import PropTypes from "prop-types";
import { Grid, Button } from "antd-mobile";
import styles from "./BottomBtn.module.less";

const BottomBtn = (props) => {
  return (
    <div className={styles["button-container"]}>
      <Grid columns={props.items.length} gap={16} style={{ padding: "0 12px" }}>
        {props.items.map((i, idx) => (
          <Grid.Item key={idx}>
            <Button color={i.color} onClick={i.handler} disabled={i.disabled}>
              {i.btnTxt}
            </Button>
          </Grid.Item>
        ))}
      </Grid>
    </div>
  );
};

BottomBtn.propTypes = {
  items: PropTypes.array,
};

export default BottomBtn;
